

const JWT_KEY = "jwt";
const JWTOBJ_KEY = "jwtobj";


const obj = {

    getJwt: function() {
        return localStorage.getItem(JWT_KEY);
    },

    getJwtObj: function() {
        return localStorage.getItem(JWTOBJ_KEY);
    },

    removeJwt : function() {
        localStorage.removeItem(JWT_KEY);
        localStorage.removeItem(JWTOBJ_KEY);
    },

    isLogin: function() {
        return localStorage.getItem(JWT_KEY) && localStorage.getItem(JWTOBJ_KEY);
    },

    setJwt: function(jwt, decoded) {
        localStorage.setItem(JWT_KEY, jwt);
        localStorage.setItem(JWTOBJ_KEY, decoded);
    },

};

export default obj;